package com.lijie.userservice.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lijie.userservice.entity.TbUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author ange
 * @since 2020-07-19
 */
@Mapper
public interface TbUserMapper extends BaseMapper<TbUser> {
    List<TbUser> findUserAndDept(@Param("current") Integer current,@Param("size") Integer size);

    Integer findUserAndDeptCount();

    IPage<TbUser> findUserPage(Page<TbUser> page, @Param(Constants.WRAPPER) QueryWrapper<TbUser> wrapper);
    boolean updateStatus(@Param ("id") Integer id,@Param ("status") Integer status);
}
